<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function coolModule(id) {
            function identify() {
                console.log(id);
            }
            return {
                identify: identify
            }
        }
        let foo1 = coolModule('cool Module1')
        foo1.identify()
        let foo2 = coolModule('cool Module2')
        foo2.identify()
    </script>
</body>

</html>